package jk;

public class ring {

    static int a[] = {0,0,0,0,0,0,0,0,0,0};
    public static void main (String[]args){
        print();
        kill();
        print();
    }

    public static void print(){
        for(int i=0;i<a.length;i++){
            System.out.print(a[i]+"\t");
        }
        System.out.println();
    }

    public static void kill(){
        int count = 0;
        int count2 = a.length;
        int i = 0;
        while(true){
            if(a[i]==0){ count++; }
            if(count==3){
                count=0;
                a[i]=1;
                count2--;
                if(count2==1){ break;}
            }
            i++;
            if(i==a.length){ i=0; }
        }
    }
}
